<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="css/layer.css"/>
	<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/layer.js"></script>
<script src="js/jq.cookie.js"></script>
	</head>
	<style>
		.password{
			width: 90%;
			margin-left: 5%;
		}
		.form-control{
			display: inline-block;
			width: 75%;
			display: inline-block;
		}
		.password label{
			width:25%;
		}
		.password div{
			margin-top: 20px;
		}
		.submit{
			text-align: center;
		}
		button{
			width: 100px;
			height: 35px;
			background: #3c8dbc;
			color: white;
			margin-top: 20px;
		}
	</style>
	<body>
		<div class="password">
			<div>
				<label>姓名：</label><input class="form-control " type="text" autocomplete="off" />
			</div>
			<div>
				<label>手机号：</label><input class="form-control " type="text" autocomplete="off" />
			</div>
			<div>
				<label>邮编</label><input class="form-control " type="text" autocomplete="off" />
			</div>
			<div>
				<label>收获地址：</label><input class="form-control " type="text" autocomplete="off"  />
			</div>
			<div class="submit">
				<button class="save_btn">提交</button>
			</div>
		</div>
		
		
	</body>
</html>
<script>
	function GetQueryString(name)
	{
	     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
	     var r = window.location.search.substr(1).match(reg);
	     if(r!=null)return  unescape(r[2]); return null;
	}
	var orderNum = GetQueryString('num');
	
	//初始化
	
	$.ajax({
				type:"get",
		url:"https://www.retux.cn/MgOrderDetail",
		async:true,
		data:{
			Id:orderNum
		},
		success:function(data){
			
			for(var i=0;i<data[2].length;i++){
				$('input').eq(i).val(data[2][i]);
					}
				}
			});	
	
	$('.save_btn').click(function(){
	$.ajax({
		type:"get",
		url:"https://www.retux.cn/MgOrderDetailSubmit",
		async:true,
		data:{
			Id:orderNum,
			Name:$('input').eq(0).val(),
			Phone:$('input').eq(1).val(),
			ZipCode:$('input').eq(2).val(),
			Address:$('input').eq(3).val(),
			UserId:$.cookie('UserId')
			
		},
		success:function(data){
			if(data=='success'){
				layer.msg('提交成功');
				parent.location.reload();
			}else{
				layer.msg('提交失败');
					}
					
				}
		});
	})
</script>